import service from '@/request/index';

// 分类列表
// parent_ids:[]
export const categories = (data) => {
    return service({
        url: '/categories',
        method: 'post',
        data: JSON.stringify(data)
    })
}

// 产品列表
// keyword      关键词搜索
// category_id  商品类别id (数组)
// brand_id     站点id
// per_page     一页多少条
// page         第几页
export const productList = (params) => {
    return service({
        url: '/products',
        method: 'get',
        params
    })
}

// 产品详情
export const productDetails = (params) => {
    return service({
        url: `/products/${params}`,
        method: 'get',
    })
}

// 收藏列表
export const gameLikes = () => {
    return service({
        url: '/gameLikes',
        method: 'get',
    })
}

// 添加收藏
// {productId:''}
export const gameLikesAdd = (data) => {
    return service({
        url: '/gameLikes/add',
        method: 'post',
        data: JSON.stringify(data)
    })
}

// 删除收藏
// {"product_ids": [1，2]}
export const gameLikesDelete = (data) => {
    return service({
        url: '/gameLikes/delete',
        method: 'post',
        data: JSON.stringify(data)
    })
}